<?php

/* @var $this yii\web\View */

?>
<div class="container container-box">
    <div>
        <span class="txt-first"><?= '抓取测试' ?></span>
        <div>
            <form id="verify_rule" class="create-group" method="post" action="/test/ajaxcrawl">
                <textarea name="ta_rule" style="resize:none;width:600px;height:200px;border: 1px solid #ddd;"></textarea>
                <br/><br/>
                <input type="submit" value="提交" class="btn"/><br/>
            </form>
            <br/>
            <textarea id="ta_rule_parse" name="ta_rule_parse" style="resize:none;width:600px;height:200px;border: 1px solid #ddd;"></textarea>
        </div>
    </div>

</div>
<!-- jqeury.form.js -->
<?php $this->beginBlock('work') ?>
    $().ready(function() {
        <?php Yii::info('bind submit'); ?>
        $(document).ready(function() {
            var opts = {
                beforeSubmit: function(formData, $jqForm, options) {
                    return true;
                },
                success: function(respTxt, statusTxt, xhr, $jqForm) {
                    $('#ta_rule_parse').html(respTxt);
                }
            };
            $('#verify_rule').ajaxForm(opts);
        });
    });
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['work'], \yii\web\View::POS_END); ?>